﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ElfTyping.Quests;
using Microsoft.Xna.Framework;
using ElfTyping.General;

namespace ElfTyping.States.StoryState
{
    public class QuestStartState : State
    {
        static Rectangle BgRect = new Rectangle(0, 0, 800, 600);
        static Point QuestTextCenter = new Point(400, 250);
        static Point NameTextCenter = new Point(400, 350);

        Quest Quest { get; set; }

        public QuestStartState(Quest quest)
        {
            Quest = quest;
            
        }

        public override void InitializeState()
        {            
        }

        public override void Draw(Camera camera)
        {
            Quest.QuestTitleImage.Draw(camera, BgRect);
            
            camera.MakeText("Quest " + Quest.QuestNumber)
                .WithCenteredPosition(QuestTextCenter)
                .WithFont(Camera.TextDrawer.TimesNewRomanBigFont)
                .WithColor(Color.Black)
                .Draw();
            camera.MakeText(Quest.Name)
                .WithCenteredPosition(NameTextCenter)
                .WithFont(Camera.TextDrawer.TimesNewRomanBigFont)
                .WithColor(Color.Black)
                .Draw();
        }

        public override void HandleInput(InputInfo inputInfo)
        {
            if (inputInfo.IsKeyJustPressed(GameKey.Use))
            {
                ChangeStateAfterTick(new StoryState(Quest.QuestNumber, 1), true);
            }
        }
    }
}
